package com.young.shop.pojo.entity;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.Objects;

/**
 * @author 曾家乐
 * @version 1.0
 * @date 2021-01-08 10:39
 * 用户实体类
 */
@Repository
public class User {
    private long id;
    private String userName;
    private String password;
    private String paymentCode;
    private String email;
    private String phone;
    private String nickName;
    private String sex;
    private String birthday;
    private String realName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id &&
                Objects.equals(userName , user.userName) &&
                Objects.equals(password , user.password) &&
                Objects.equals(paymentCode , user.paymentCode) &&
                Objects.equals(email , user.email) &&
                Objects.equals(phone , user.phone) &&
                Objects.equals(nickName , user.nickName) &&
                Objects.equals(sex , user.sex) &&
                Objects.equals(birthday , user.birthday) &&
                Objects.equals(realName , user.realName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id , userName , password , paymentCode , email , phone , nickName , sex , birthday , realName);
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", paymentCode='" + paymentCode + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", nickName='" + nickName + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday='" + birthday + '\'' +
                ", realName='" + realName + '\'' +
                '}';
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPaymentCode() {
        return paymentCode;
    }

    public void setPaymentCode(String paymentCode) {
        this.paymentCode = paymentCode;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }
}
